import allure
from apis.auth_api import AuthApi
from loguru import logger


class AuthCase(AuthApi):
    @allure.step('step:case_mobile_pwd')
    def case_mobile_pwd(self, data):
        """业务case-用户登录： 手机号+密码"""
        mobile_pwd_response = self.mobile_pwd_api(**data['json'])
        res = mobile_pwd_response.json()
        return res

    @allure.step('step:code')
    def case_code(self):
        """业务case-获取图片验证码sign"""
        mobile_pwd_response = self.code_api()
        res = mobile_pwd_response.json()
        return res

    @allure.step('step:case_mobile_sms_code')
    def case_mobile_sms_code(self, data):
        """业务case-用户登录：手机号+验证码"""
        mobile_sms_code_response = self.mobile_sms_code_api(**data['json'])
        res = mobile_sms_code_response.json()
        return res


